Skip to main content

vaccine

Table Name: vaccine

The vaccine table contains information about vaccines, including their attributes, creation and modification details, and status. It plays a central role in managing vaccine-related data within the healthcare system.


Columns

Column NameData TypeConstraintsDescription
vaccineIdsmallint(6)Primary Key, Not Null, Auto IncrementUnique identifier for each vaccine.
createdDatedatetimeNullableThe date and time when the vaccine record was created.
descriptionvarchar(255)NullableDetailed description of the vaccine.
fullNamevarchar(50)NullableFull name of the vaccine.
lastEditedDatedatetimeNullableThe date and time when the vaccine record was last edited.
namevarchar(30)Not Null, UniqueUnique name of the vaccine.
shortNamevarchar(30)Not NullShort or abbreviated name of the vaccine.
createdByUserIdint(11)Nullable, Foreign KeyIdentifier of the user who created the record.
lastEditedByUserIdint(11)Nullable, Foreign KeyIdentifier of the user who last edited the record.
maxGracePeriodDaystinyint(6)NullableMaximum allowable grace period (in days) for administering the vaccine.
minGracePeriodDaystinyint(6)NullableMinimum allowable grace period (in days) for administering the vaccine.
voidReasonvarchar(255)NullableReason for voiding the vaccine record (if applicable).
voidedtinyint(1)NullableIndicates if the vaccine record has been voided (1 = voided, 0 = not voided).
voidedDatedatetimeNullableThe date and time when the vaccine record was voided.
voidedByUserIdint(11)Nullable, Foreign KeyIdentifier of the user who voided the record.
isSupplementarytinyint(1)NullableIndicates if the vaccine is supplementary (1 = yes, 0 = no).
vaccine_entityvarchar(255)NullableAdditional categorization or entity related to the vaccine.
isMandatorytinyint(1)NullableIndicates if the vaccine is mandatory (1 = yes, 0 = no).
stockVaccineGroupIdint(11)NullableIdentifier of the stock or vaccine group related to the vaccine.

Indexes

  1. Primary Key:
    • vaccineId: Ensures unique identification of each vaccine record.
  2. Unique Key:
    • name: Ensures no duplicate names exist for vaccines.
  3. Foreign Key Indexes:
    • vaccine_lastEditedByUserId_user_mappedId_FK: Links lastEditedByUserId to the user table.
    • vaccine_createdByUserId_user_mappedId_FK: Links createdByUserId to the user table.
    • vaccine_voidedByUserId_user_mappedId_FK: Links voidedByUserId to the user table.

Foreign Key Relationships

  1. user table:
    • createdByUserId: Links the vaccine record to the user who created it.
    • lastEditedByUserId: Links the vaccine record to the user who last modified it.
    • voidedByUserId: Links the vaccine record to the user who voided it.

Usage Notes

  • Purpose:
    • Stores and manages detailed information about vaccines for use in immunization programs and inventory management.
  • Key Attributes:
    • isMandatory: Helps determine required vaccines for compliance.
    • isSupplementary: Identifies additional, non-mandatory vaccines.
    • minGracePeriodDays and maxGracePeriodDays: Provide rules for vaccine administration timelines.
  • Query Optimization:
    • Use the name index for fast lookup of vaccines by name.
    • Use voided and isMandatory columns for reporting and filtering.